declare prop array c#

33

declare prop array c# -

private int[] myNumbers;
public int[] MyNumbers
{
    get { return myNumbers; }
    set { myNumbers = value; }
}

declare prop array c# -

class DemoClass
{
    public int[] MyNumbers { get; private set; }

    public DemoClass(int elements)
    {
        MyNumbers = new int[elements];
    }
}

Comments

Submit
0 Comments